package net.luoran.dvm.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.luoran.dvm.entity.ElementDO;
import net.luoran.dvm.entity.ElementGroupDO;
import net.luoran.dvm.entity.SysFileDO;
import net.luoran.dvm.mapper.ElementGroupMapper;
import net.luoran.dvm.service.ElementGroupService;
import net.luoran.dvm.service.ElementService;
import net.luoran.dvm.service.SysFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 数据元素分组 服务实现类
 * </p>
 *
 * @author MyBatisPlusGenerater
 * @since 2020-10-29
 */
@Service
@Transactional
public class ElementGroupServiceImpl extends ServiceImpl<ElementGroupMapper, ElementGroupDO> implements ElementGroupService {

    @Autowired
    private ElementGroupMapper elementGroupMapper;

    @Override
    public void removeByGroupIds(List<Integer> groupIds) {
        elementGroupMapper.deleteBatchIds(groupIds);
    }

    @Override
    public void saveElementGroup(ElementGroupDO elementGroupDO) {
        elementGroupMapper.insert(elementGroupDO);
    }

    @Override
    public void saveOrUpdateElementGroupDO(ElementGroupDO elementGroupDO) {
        elementGroupMapper.updateById(elementGroupDO);
    }
}
